import React from 'react';
import { Button, Checkbox, Form, Input } from 'antd';
const onFinish = values => {
    console.log('Success:', values);
};
// 定义一个名为MyForm的函数组件
const MyForm = () => (
    <Form
        onFinish={onFinish}
    >
        <Form.Item
            label="Username"    // 表单项的标签
            name="username"         // 表单项的名称
            rules={[{ required: true, message: '请输入账号' }]}   // 表单校验项
        >
            <Input />
        </Form.Item>

        <Form.Item
            label="Password"
            name="password"
            rules={[{ required: true, message: '请输入密码' }]}
        >
            <Input.Password />
        </Form.Item>

        <Form.Item name="remember" valuePropName="checked" label={null}>
            <Checkbox>Remember me</Checkbox>
        </Form.Item>

        <Form.Item label={null}>
            <Button type="primary" htmlType="submit">
                Submit
            </Button>
        </Form.Item>
    </Form>
);
export default MyForm;